/*! For license information please see typesense.min.js.LICENSE.txt */ var Typesense;(()=>{var t={43:function(t,e,n){var r,o;!function(i,a){"use strict";r=function(){var t=function(){},e="undefined",n=typeof window!==e&&typeof window.navigator!==e&&/Trident\/|MSIE /.test(window.navigator.userAgent),r=["trace","debug","info","warn","error"],o={},i=null;function a(t,e){var n=t[e];if("function"==typeof n.bind)return n.bind(t);try{return Function.prototype.bind.call(n,t)}catch(e){return function(){return Function.prototype.apply.apply(n,[t,arguments])}}}function s(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function c(){for(var n=this.getLevel(),o=0;o=0&&e<=h.levels.SILENT)return e;throw new TypeError("log.setLevel() called with invalid level: "+t)}"string"==typeof t?p+=":"+t:"symbol"==typeof t&&(p=void 0),h.name=t,h.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},h.methodFactory=n||l,h.getLevel=function(){return null!=u?u:null!=s?s:a},h.setLevel=function(t,n){return u=d(t),!1!==n&&function(t){var n=(r[t]||"silent").toUpperCase();if(typeof window!==e&&p){try{return void(window.localStorage[p]=n)}catch(t){}try{window.document.cookie=encodeURIComponent(p)+"="+n+";"}catch(t){}}}(u),c.call(h)},h.setDefaultLevel=function(t){s=d(t),f()||h.setLevel(t,!1)},h.resetLevel=function(){u=null,function(){if(typeof window!==e&&p){try{window.localStorage.removeItem(p)}catch(t){}try{window.document.cookie=encodeURIComponent(p)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(t){}}}(),c.call(h)},h.enableAll=function(t){h.setLevel(h.levels.TRACE,t)},h.disableAll=function(t){h.setLevel(h.levels.SILENT,t)},h.rebuild=function(){if(i!==h&&(a=d(i.getLevel())),c.call(h),i===h)for(var t in o)o[t].rebuild()},a=d(i?i.getLevel():"WARN");var y=f();null!=y&&(u=d(y)),c.call(h)}(i=new h).getLogger=function(t){if("symbol"!=typeof t&&"string"!=typeof t||""===t)throw new TypeError("You must supply a name when creating a logger.");var e=o[t];return e||(e=o[t]=new h(t,i.methodFactory)),e};var p=typeof window!==e?window.log:void 0;return i.noConflict=function(){return typeof window!==e&&window.log===i&&(window.log=p),i},i.getLoggers=function(){return o},i.default=i,i},void 0===(o=r.call(e,n,e,t))||(t.exports=o)}()},565:()=>{},61:(t,e,n)=>{var r=n(698).default;function o(){"use strict";t.exports=o=function(){return n},t.exports.__esModule=!0,t.exports.default=t.exports;var e,n={},i=Object.prototype,a=i.hasOwnProperty,s=Object.defineProperty||function(t,e,n){t[e]=n.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",l=c.asyncIterator||"@@asyncIterator",h=c.toStringTag||"@@toStringTag";function p(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{p({},"")}catch(e){p=function(t,e,n){return t[e]=n}}function f(t,e,n,r){var o=e&&e.prototype instanceof b?e:b,i=Object.create(o.prototype),a=new _(r||[]);return s(i,"_invoke",{value:A(t,n,a)}),i}function d(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}n.wrap=f;var y="suspendedStart",v="suspendedYield",m="executing",g="completed",w={};function b(){}function C(){}function k(){}var E={};p(E,u,(function(){return this}));var S=Object.getPrototypeOf,R=S&&S(S(U([])));R&&R!==i&&a.call(R,u)&&(E=R);var O=k.prototype=b.prototype=Object.create(E);function P(t){["next","throw","return"].forEach((function(e){p(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function n(o,i,s,c){var u=d(t[o],t,i);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==r(h)&&a.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,s,c)}),(function(t){n("throw",t,s,c)})):e.resolve(h).then((function(t){l.value=t,s(l)}),(function(t){return n("throw",t,s,c)}))}c(u.arg)}var o;s(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}})}function A(t,n,r){var o=y;return function(i,a){if(o===m)throw new Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var c=T(s,r);if(c){if(c===w)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===y)throw o=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=m;var u=d(t,n,r);if("normal"===u.type){if(o=r.done?g:v,u.arg===w)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=g,r.method="throw",r.arg=u.arg)}}}function T(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),w;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,w;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,w):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,w)}function N(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function _(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function U(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),j(n),w}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;j(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:U(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),w}},n}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports},698:t=>{function e(n){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},687:(t,e,n)=>{var r=n(61)();t.exports=r;try{regeneratorRuntime=r}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={exports:{}};return t[r].call(i.exports,i,i.exports,n),i.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};(()=>{"use strict";n.r(r),n.d(r,{Client:()=>jn,Errors:()=>e,SearchClient:()=>Un,default:()=>Ln});var t={};n.r(t),n.d(t,{hasBrowserEnv:()=>At,hasStandardBrowserEnv:()=>Tt,hasStandardBrowserWebWorkerEnv:()=>jt});var e={};function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function a(t){var e=function(t,e){if("object"!=i(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==i(e)?e:String(e)}function s(t,e){for(var n=0;nHe,ImportError:()=>Je,MissingConfigurationError:()=>E,ObjectAlreadyExists:()=>Ae,ObjectNotFound:()=>Oe,ObjectUnprocessable:()=>je,RequestMalformed:()=>be,RequestUnauthorized:()=>Ee,ServerError:()=>Le,TypesenseError:()=>b});var l=n(43);function h(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function p(t,e){if(e&&("object"===i(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return h(t)}function f(t){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},f(t)}function d(t,e){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},d(t,e)}function y(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&d(t,e)}function v(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(v=function(){return!!t})()}function m(t){var e="function"==typeof Map?new Map:void 0;return m=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return function(t,e,n){if(v())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var o=new(t.bind.apply(t,r));return n&&d(o,n.prototype),o}(t,arguments,f(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),d(n,t)},m(t)}function g(t,e,n){return e=f(e),p(t,w()?Reflect.construct(e,n||[],f(t).constructor):e.apply(t,n))}function w(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(w=function(){return!!t})()}var b=function(t){function e(t){var n;return o(this,e),(n=g(this,e,[t])).name=(this instanceof e?this.constructor:void 0).name,Object.setPrototypeOf(h(n),(this instanceof e?this.constructor:void 0).prototype),n}return y(e,t),c(e)}(m(Error));function C(t,e,n){return e=f(e),p(t,k()?Reflect.construct(e,n||[],f(t).constructor):e.apply(t,n))}function k(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(k=function(){return!!t})()}var E=function(t){function e(){return o(this,e),C(this,e,arguments)}return y(e,t),c(e)}(b);function S(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}var R=function(){function t(e){var n=this;o(this,t),this.nodes=e.nodes||[],this.nodes=this.nodes.map((function(t){return n.setDefaultPathInNode(t)})).map((function(t){return n.setDefaultPortInNode(t)})).map((function(t){return function(t){for(var e=1;e0;e--){var n=Math.floor(Math.random()*(e+1)),r=[t[n],t[e]];t[e]=r[0],t[n]=r[1]}}}]),t}();function O(t,e,n,r,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,o)}function P(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){O(i,r,o,a,s,"next",t)}function s(t){O(i,r,o,a,s,"throw",t)}a(void 0)}))}}var x=n(687),A=n.n(x);function T(t,e){return function(){return t.apply(e,arguments)}}const{toString:N}=Object.prototype,{getPrototypeOf:j}=Object,_=(U=Object.create(null),t=>{const e=N.call(t);return U[e]||(U[e]=e.slice(8,-1).toLowerCase())});var U;const L=t=>(t=t.toLowerCase(),e=>_(e)===t),F=t=>e=>typeof e===t,{isArray:B}=Array,H=F("undefined"),D=L("ArrayBuffer"),q=F("string"),I=F("function"),M=F("number"),K=t=>null!==t&&"object"==typeof t,z=t=>{if("object"!==_(t))return!1;const e=j(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Symbol.toStringTag in t||Symbol.iterator in t)},J=L("Date"),W=L("File"),G=L("Blob"),Q=L("FileList"),V=L("URLSearchParams");function $(t,e,{allOwnKeys:n=!1}={}){if(null==t)return;let r,o;if("object"!=typeof t&&(t=[t]),B(t))for(r=0,o=t.length;r0;)if(r=n[o],e===r.toLowerCase())return r;return null}const Y="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Z=t=>!H(t)&&t!==Y,tt=(et="undefined"!=typeof Uint8Array&&j(Uint8Array),t=>et&&t instanceof et);var et;const nt=L("HTMLFormElement"),rt=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),ot=L("RegExp"),it=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};$(n,((n,o)=>{let i;!1!==(i=e(n,o,t))&&(r[o]=i||n)})),Object.defineProperties(t,r)},at="abcdefghijklmnopqrstuvwxyz",st="0123456789",ct={DIGIT:st,ALPHA:at,ALPHA_DIGIT:at+at.toUpperCase()+st},ut=L("AsyncFunction"),lt={isArray:B,isArrayBuffer:D,isBuffer:function(t){return null!==t&&!H(t)&&null!==t.constructor&&!H(t.constructor)&&I(t.constructor.isBuffer)&&t.constructor.isBuffer(t)},isFormData:t=>{let e;return t&&("function"==typeof FormData&&t instanceof FormData||I(t.append)&&("formdata"===(e=_(t))||"object"===e&&I(t.toString)&&"[object FormData]"===t.toString()))},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&D(t.buffer),e},isString:q,isNumber:M,isBoolean:t=>!0===t||!1===t,isObject:K,isPlainObject:z,isUndefined:H,isDate:J,isFile:W,isBlob:G,isRegExp:ot,isFunction:I,isStream:t=>K(t)&&I(t.pipe),isURLSearchParams:V,isTypedArray:tt,isFileList:Q,forEach:$,merge:function t(){const{caseless:e}=Z(this)&&this||{},n={},r=(r,o)=>{const i=e&&X(n,o)||o;z(n[i])&&z(r)?n[i]=t(n[i],r):z(r)?n[i]=t({},r):B(r)?n[i]=r.slice():n[i]=r};for(let t=0,e=arguments.length;t($(e,((e,r)=>{n&&I(e)?t[r]=T(e,n):t[r]=e}),{allOwnKeys:r}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},toFlatObject:(t,e,n,r)=>{let o,i,a;const s={};if(e=e||{},null==t)return e;do{for(o=Object.getOwnPropertyNames(t),i=o.length;i-- >0;)a=o[i],r&&!r(a,t,e)||s[a]||(e[a]=t[a],s[a]=!0);t=!1!==n&&j(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},kindOf:_,kindOfTest:L,endsWith:(t,e,n)=>{t=String(t),(void 0===n||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return-1!==r&&r===n},toArray:t=>{if(!t)return null;if(B(t))return t;let e=t.length;if(!M(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},forEachEntry:(t,e)=>{const n=(t&&t[Symbol.iterator]).call(t);let r;for(;(r=n.next())&&!r.done;){const n=r.value;e.call(t,n[0],n[1])}},matchAll:(t,e)=>{let n;const r=[];for(;null!==(n=t.exec(e));)r.push(n);return r},isHTMLForm:nt,hasOwnProperty:rt,hasOwnProp:rt,reduceDescriptors:it,freezeMethods:t=>{it(t,((e,n)=>{if(I(t)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=t[n];I(r)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(t,e)=>{const n={},r=t=>{t.forEach((t=>{n[t]=!0}))};return B(t)?r(t):r(String(t).split(e)),n},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(t,e,n){return e.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(t,e)=>(t=+t,Number.isFinite(t)?t:e),findKey:X,global:Y,isContextDefined:Z,ALPHABET:ct,generateString:(t=16,e=ct.ALPHA_DIGIT)=>{let n="";const{length:r}=e;for(;t--;)n+=e[Math.random()*r|0];return n},isSpecCompliantForm:function(t){return!!(t&&I(t.append)&&"FormData"===t[Symbol.toStringTag]&&t[Symbol.iterator])},toJSONObject:t=>{const e=new Array(10),n=(t,r)=>{if(K(t)){if(e.indexOf(t)>=0)return;if(!("toJSON"in t)){e[r]=t;const o=B(t)?[]:{};return $(t,((t,e)=>{const i=n(t,r+1);!H(i)&&(o[e]=i)})),e[r]=void 0,o}}return t};return n(t,0)},isAsyncFn:ut,isThenable:t=>t&&(K(t)||I(t))&&I(t.then)&&I(t.catch)};function ht(t,e,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o)}lt.inherits(ht,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:lt.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const pt=ht.prototype,ft={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((t=>{ft[t]={value:t}})),Object.defineProperties(ht,ft),Object.defineProperty(pt,"isAxiosError",{value:!0}),ht.from=(t,e,n,r,o,i)=>{const a=Object.create(pt);return lt.toFlatObject(t,a,(function(t){return t!==Error.prototype}),(t=>"isAxiosError"!==t)),ht.call(a,t.message,e,n,r,o),a.cause=t,a.name=t.name,i&&Object.assign(a,i),a};const dt=ht;function yt(t){return lt.isPlainObject(t)||lt.isArray(t)}function vt(t){return lt.endsWith(t,"[]")?t.slice(0,-2):t}function mt(t,e,n){return t?t.concat(e).map((function(t,e){return t=vt(t),!n&&e?"["+t+"]":t})).join(n?".":""):e}const gt=lt.toFlatObject(lt,{},null,(function(t){return/^is[A-Z]/.test(t)})),wt=function(t,e,n){if(!lt.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const r=(n=lt.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!lt.isUndefined(e[t])}))).metaTokens,o=n.visitor||u,i=n.dots,a=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&<.isSpecCompliantForm(e);if(!lt.isFunction(o))throw new TypeError("visitor must be a function");function c(t){if(null===t)return"";if(lt.isDate(t))return t.toISOString();if(!s&<.isBlob(t))throw new dt("Blob is not supported. Use a Buffer instead.");return lt.isArrayBuffer(t)||lt.isTypedArray(t)?s&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function u(t,n,o){let s=t;if(t&&!o&&"object"==typeof t)if(lt.endsWith(n,"{}"))n=r?n:n.slice(0,-2),t=JSON.stringify(t);else if(lt.isArray(t)&&function(t){return lt.isArray(t)&&!t.some(yt)}(t)||(lt.isFileList(t)||lt.endsWith(n,"[]"))&&(s=lt.toArray(t)))return n=vt(n),s.forEach((function(t,r){!lt.isUndefined(t)&&null!==t&&e.append(!0===a?mt([n],r,i):null===a?n:n+"[]",c(t))})),!1;return!!yt(t)||(e.append(mt(o,n,i),c(t)),!1)}const l=[],h=Object.assign(gt,{defaultVisitor:u,convertValue:c,isVisitable:yt});if(!lt.isObject(t))throw new TypeError("data must be an object");return function t(n,r){if(!lt.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),lt.forEach(n,(function(n,i){!0===(!(lt.isUndefined(n)||null===n)&&o.call(e,n,lt.isString(i)?i.trim():i,r,h))&&t(n,r?r.concat(i):[i])})),l.pop()}}(t),e};function bt(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function(t){return e[t]}))}function Ct(t,e){this._pairs=[],t&&wt(t,this,e)}const kt=Ct.prototype;kt.append=function(t,e){this._pairs.push([t,e])},kt.toString=function(t){const e=t?function(e){return t.call(this,e,bt)}:bt;return this._pairs.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};const Et=Ct;function St(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Rt(t,e,n){if(!e)return t;const r=n&&n.encode||St,o=n&&n.serialize;let i;if(i=o?o(e,n):lt.isURLSearchParams(e)?e.toString():new Et(e,n).toString(r),i){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+i}return t}const Ot=class{constructor(){this.handlers=[]}use(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){lt.forEach(this.handlers,(function(e){null!==e&&t(e)}))}},Pt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},xt={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Et,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},At="undefined"!=typeof window&&"undefined"!=typeof document,Tt=(Nt="undefined"!=typeof navigator&&navigator.product,At&&["ReactNative","NativeScript","NS"].indexOf(Nt)<0);var Nt;const jt="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,_t={...t,...xt},Ut=function(t){function e(t,n,r,o){let i=t[o++];if("__proto__"===i)return!0;const a=Number.isFinite(+i),s=o>=t.length;return i=!i&<.isArray(r)?r.length:i,s?(lt.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!a):(r[i]&<.isObject(r[i])||(r[i]=[]),e(t,n,r[i],o)&<.isArray(r[i])&&(r[i]=function(t){const e={},n=Object.keys(t);let r;const o=n.length;let i;for(r=0;r{e(function(t){return lt.matchAll(/\w+|\[(\w*)]/g,t).map((t=>"[]"===t[0]?"":t[1]||t[0]))}(t),r,n,0)})),n}return null},Lt={transitional:Pt,adapter:["xhr","http"],transformRequest:[function(t,e){const n=e.getContentType()||"",r=n.indexOf("application/json")>-1,o=lt.isObject(t);if(o&<.isHTMLForm(t)&&(t=new FormData(t)),lt.isFormData(t))return r?JSON.stringify(Ut(t)):t;if(lt.isArrayBuffer(t)||lt.isBuffer(t)||lt.isStream(t)||lt.isFile(t)||lt.isBlob(t))return t;if(lt.isArrayBufferView(t))return t.buffer;if(lt.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let i;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return wt(t,new _t.classes.URLSearchParams,Object.assign({visitor:function(t,e,n,r){return _t.isNode&<.isBuffer(t)?(this.append(e,t.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},e))}(t,this.formSerializer).toString();if((i=lt.isFileList(t))||n.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return wt(i?{"files[]":t}:t,e&&new e,this.formSerializer)}}return o||r?(e.setContentType("application/json",!1),function(t,e,n){if(lt.isString(t))try{return(0,JSON.parse)(t),lt.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||Lt.transitional,n=e&&e.forcedJSONParsing,r="json"===this.responseType;if(t&<.isString(t)&&(n&&!this.responseType||r)){const n=!(e&&e.silentJSONParsing)&&r;try{return JSON.parse(t)}catch(t){if(n){if("SyntaxError"===t.name)throw dt.from(t,dt.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:_t.classes.FormData,Blob:_t.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};lt.forEach(["delete","get","head","post","put","patch"],(t=>{Lt.headers[t]={}}));const Ft=Lt,Bt=lt.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Ht=Symbol("internals");function Dt(t){return t&&String(t).trim().toLowerCase()}function qt(t){return!1===t||null==t?t:lt.isArray(t)?t.map(qt):String(t)}function It(t,e,n,r,o){return lt.isFunction(r)?r.call(this,e,n):(o&&(e=n),lt.isString(e)?lt.isString(r)?-1!==e.indexOf(r):lt.isRegExp(r)?r.test(e):void 0:void 0)}class Mt{constructor(t){t&&this.set(t)}set(t,e,n){const r=this;function o(t,e,n){const o=Dt(e);if(!o)throw new Error("header name must be a non-empty string");const i=lt.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||e]=qt(t))}const i=(t,e)=>lt.forEach(t,((t,n)=>o(t,n,e)));return lt.isPlainObject(t)||t instanceof this.constructor?i(t,e):lt.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim())?i((t=>{const e={};let n,r,o;return t&&t.split("\n").forEach((function(t){o=t.indexOf(":"),n=t.substring(0,o).trim().toLowerCase(),r=t.substring(o+1).trim(),!n||e[n]&&Bt[n]||("set-cookie"===n?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)})),e})(t),e):null!=t&&o(e,t,n),this}get(t,e){if(t=Dt(t)){const n=lt.findKey(this,t);if(n){const t=this[n];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}(t);if(lt.isFunction(e))return e.call(this,t,n);if(lt.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=Dt(t)){const n=lt.findKey(this,t);return!(!n||void 0===this[n]||e&&!It(0,this[n],n,e))}return!1}delete(t,e){const n=this;let r=!1;function o(t){if(t=Dt(t)){const o=lt.findKey(n,t);!o||e&&!It(0,n[o],o,e)||(delete n[o],r=!0)}}return lt.isArray(t)?t.forEach(o):o(t),r}clear(t){const e=Object.keys(this);let n=e.length,r=!1;for(;n--;){const o=e[n];t&&!It(0,this[o],o,t,!0)||(delete this[o],r=!0)}return r}normalize(t){const e=this,n={};return lt.forEach(this,((r,o)=>{const i=lt.findKey(n,o);if(i)return e[i]=qt(r),void delete e[o];const a=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,n)=>e.toUpperCase()+n))}(o):String(o).trim();a!==o&&delete e[o],e[a]=qt(r),n[a]=!0})),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return lt.forEach(this,((n,r)=>{null!=n&&!1!==n&&(e[r]=t&<.isArray(n)?n.join(", "):n)})),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([t,e])=>t+": "+e)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const n=new this(t);return e.forEach((t=>n.set(t))),n}static accessor(t){const e=(this[Ht]=this[Ht]={accessors:{}}).accessors,n=this.prototype;function r(t){const r=Dt(t);e[r]||(function(t,e){const n=lt.toCamelCase(" "+e);["get","set","has"].forEach((r=>{Object.defineProperty(t,r+n,{value:function(t,n,o){return this[r].call(this,e,t,n,o)},configurable:!0})}))}(n,t),e[r]=!0)}return lt.isArray(t)?t.forEach(r):r(t),this}}Mt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),lt.reduceDescriptors(Mt.prototype,(({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[n]=t}}})),lt.freezeMethods(Mt);const Kt=Mt;function zt(t,e){const n=this||Ft,r=e||n,o=Kt.from(r.headers);let i=r.data;return lt.forEach(t,(function(t){i=t.call(n,i,o.normalize(),e?e.status:void 0)})),o.normalize(),i}function Jt(t){return!(!t||!t.__CANCEL__)}function Wt(t,e,n){dt.call(this,null==t?"canceled":t,dt.ERR_CANCELED,e,n),this.name="CanceledError"}lt.inherits(Wt,dt,{__CANCEL__:!0});const Gt=Wt,Qt=_t.hasStandardBrowserEnv?{write(t,e,n,r,o,i){const a=[t+"="+encodeURIComponent(e)];lt.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),lt.isString(r)&&a.push("path="+r),lt.isString(o)&&a.push("domain="+o),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Vt(t,e){return t&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)?function(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}const $t=_t.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),e=document.createElement("a");let n;function r(n){let r=n;return t&&(e.setAttribute("href",r),r=e.href),e.setAttribute("href",r),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:"/"===e.pathname.charAt(0)?e.pathname:"/"+e.pathname}}return n=r(window.location.href),function(t){const e=lt.isString(t)?r(t):t;return e.protocol===n.protocol&&e.host===n.host}}():function(){return!0};function Xt(t,e){let n=0;const r=function(t,e){t=t||10;const n=new Array(t),r=new Array(t);let o,i=0,a=0;return e=void 0!==e?e:1e3,function(s){const c=Date.now(),u=r[a];o||(o=c),n[i]=s,r[i]=c;let l=a,h=0;for(;l!==i;)h+=n[l++],l%=t;if(i=(i+1)%t,i===a&&(a=(a+1)%t),c-o{const i=o.loaded,a=o.lengthComputable?o.total:void 0,s=i-n,c=r(s);n=i;const u={loaded:i,total:a,progress:a?i/a:void 0,bytes:s,rate:c||void 0,estimated:c&&a&&i<=a?(a-i)/c:void 0,event:o};u[e?"download":"upload"]=!0,t(u)}}const Yt={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(t){return new Promise((function(e,n){let r=t.data;const o=Kt.from(t.headers).normalize();let i,a,{responseType:s,withXSRFToken:c}=t;function u(){t.cancelToken&&t.cancelToken.unsubscribe(i),t.signal&&t.signal.removeEventListener("abort",i)}if(lt.isFormData(r))if(_t.hasStandardBrowserEnv||_t.hasStandardBrowserWebWorkerEnv)o.setContentType(!1);else if(!1!==(a=o.getContentType())){const[t,...e]=a?a.split(";").map((t=>t.trim())).filter(Boolean):[];o.setContentType([t||"multipart/form-data",...e].join("; "))}let l=new XMLHttpRequest;if(t.auth){const e=t.auth.username||"",n=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";o.set("Authorization","Basic "+btoa(e+":"+n))}const h=Vt(t.baseURL,t.url);function p(){if(!l)return;const r=Kt.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders());!function(t,e,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?e(new dt("Request failed with status code "+n.status,[dt.ERR_BAD_REQUEST,dt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):t(n)}((function(t){e(t),u()}),(function(t){n(t),u()}),{data:s&&"text"!==s&&"json"!==s?l.response:l.responseText,status:l.status,statusText:l.statusText,headers:r,config:t,request:l}),l=null}if(l.open(t.method.toUpperCase(),Rt(h,t.params,t.paramsSerializer),!0),l.timeout=t.timeout,"onloadend"in l?l.onloadend=p:l.onreadystatechange=function(){l&&4===l.readyState&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))&&setTimeout(p)},l.onabort=function(){l&&(n(new dt("Request aborted",dt.ECONNABORTED,t,l)),l=null)},l.onerror=function(){n(new dt("Network Error",dt.ERR_NETWORK,t,l)),l=null},l.ontimeout=function(){let e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const r=t.transitional||Pt;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),n(new dt(e,r.clarifyTimeoutError?dt.ETIMEDOUT:dt.ECONNABORTED,t,l)),l=null},_t.hasStandardBrowserEnv&&(c&<.isFunction(c)&&(c=c(t)),c||!1!==c&&$t(h))){const e=t.xsrfHeaderName&&t.xsrfCookieName&&Qt.read(t.xsrfCookieName);e&&o.set(t.xsrfHeaderName,e)}void 0===r&&o.setContentType(null),"setRequestHeader"in l&<.forEach(o.toJSON(),(function(t,e){l.setRequestHeader(e,t)})),lt.isUndefined(t.withCredentials)||(l.withCredentials=!!t.withCredentials),s&&"json"!==s&&(l.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&l.addEventListener("progress",Xt(t.onDownloadProgress,!0)),"function"==typeof t.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",Xt(t.onUploadProgress)),(t.cancelToken||t.signal)&&(i=e=>{l&&(n(!e||e.type?new Gt(null,t,l):e),l.abort(),l=null)},t.cancelToken&&t.cancelToken.subscribe(i),t.signal&&(t.signal.aborted?i():t.signal.addEventListener("abort",i)));const f=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(h);f&&-1===_t.protocols.indexOf(f)?n(new dt("Unsupported protocol "+f+":",dt.ERR_BAD_REQUEST,t)):l.send(r||null)}))}};lt.forEach(Yt,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));const Zt=t=>`- ${t}`,te=t=>lt.isFunction(t)||null===t||!1===t,ee=t=>{t=lt.isArray(t)?t:[t];const{length:e}=t;let n,r;const o={};for(let i=0;i`adapter ${t} `+(!1===e?"is not supported by the environment":"is not available in the build")));let n=e?t.length>1?"since :\n"+t.map(Zt).join("\n"):" "+Zt(t[0]):"as no adapter specified";throw new dt("There is no suitable adapter to dispatch the request "+n,"ERR_NOT_SUPPORT")}return r};function ne(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Gt(null,t)}function re(t){return ne(t),t.headers=Kt.from(t.headers),t.data=zt.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),ee(t.adapter||Ft.adapter)(t).then((function(e){return ne(t),e.data=zt.call(t,t.transformResponse,e),e.headers=Kt.from(e.headers),e}),(function(e){return Jt(e)||(ne(t),e&&e.response&&(e.response.data=zt.call(t,t.transformResponse,e.response),e.response.headers=Kt.from(e.response.headers))),Promise.reject(e)}))}const oe=t=>t instanceof Kt?t.toJSON():t;function ie(t,e){e=e||{};const n={};function r(t,e,n){return lt.isPlainObject(t)&<.isPlainObject(e)?lt.merge.call({caseless:n},t,e):lt.isPlainObject(e)?lt.merge({},e):lt.isArray(e)?e.slice():e}function o(t,e,n){return lt.isUndefined(e)?lt.isUndefined(t)?void 0:r(void 0,t,n):r(t,e,n)}function i(t,e){if(!lt.isUndefined(e))return r(void 0,e)}function a(t,e){return lt.isUndefined(e)?lt.isUndefined(t)?void 0:r(void 0,t):r(void 0,e)}function s(n,o,i){return i in e?r(n,o):i in t?r(void 0,n):void 0}const c={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(t,e)=>o(oe(t),oe(e),!0)};return lt.forEach(Object.keys(Object.assign({},t,e)),(function(r){const i=c[r]||o,a=i(t[r],e[r],r);lt.isUndefined(a)&&i!==s||(n[r]=a)})),n}const ae={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{ae[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}}));const se={};ae.transitional=function(t,e,n){function r(t,e){return"[Axios v1.6.7] Transitional option '"+t+"'"+e+(n?". "+n:"")}return(n,o,i)=>{if(!1===t)throw new dt(r(o," has been removed"+(e?" in "+e:"")),dt.ERR_DEPRECATED);return e&&!se[o]&&(se[o]=!0,console.warn(r(o," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(n,o,i)}};const ce={assertOptions:function(t,e,n){if("object"!=typeof t)throw new dt("options must be an object",dt.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let o=r.length;for(;o-- >0;){const i=r[o],a=e[i];if(a){const e=t[i],n=void 0===e||a(e,i,t);if(!0!==n)throw new dt("option "+i+" must be "+n,dt.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new dt("Unknown option "+i,dt.ERR_BAD_OPTION)}},validators:ae},ue=ce.validators;class le{constructor(t){this.defaults=t,this.interceptors={request:new Ot,response:new Ot}}async request(t,e){try{return await this._request(t,e)}catch(t){if(t instanceof Error){let e;Error.captureStackTrace?Error.captureStackTrace(e={}):e=new Error;const n=e.stack?e.stack.replace(/^.+\n/,""):"";t.stack?n&&!String(t.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(t.stack+="\n"+n):t.stack=n}throw t}}_request(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=ie(this.defaults,e);const{transitional:n,paramsSerializer:r,headers:o}=e;void 0!==n&&ce.assertOptions(n,{silentJSONParsing:ue.transitional(ue.boolean),forcedJSONParsing:ue.transitional(ue.boolean),clarifyTimeoutError:ue.transitional(ue.boolean)},!1),null!=r&&(lt.isFunction(r)?e.paramsSerializer={serialize:r}:ce.assertOptions(r,{encode:ue.function,serialize:ue.function},!0)),e.method=(e.method||this.defaults.method||"get").toLowerCase();let i=o&<.merge(o.common,o[e.method]);o&<.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete o[t]})),e.headers=Kt.concat(i,o);const a=[];let s=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(s=s&&t.synchronous,a.unshift(t.fulfilled,t.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(t){c.push(t.fulfilled,t.rejected)}));let l,h=0;if(!s){const t=[re.bind(this),void 0];for(t.unshift.apply(t,a),t.push.apply(t,c),l=t.length,u=Promise.resolve(e);h{if(!n._listeners)return;let e=n._listeners.length;for(;e-- >0;)n._listeners[e](t);n._listeners=null})),this.promise.then=t=>{let e;const r=new Promise((t=>{n.subscribe(t),e=t})).then(t);return r.cancel=function(){n.unsubscribe(e)},r},t((function(t,r,o){n.reason||(n.reason=new Gt(t,r,o),e(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}static source(){let t;return{token:new pe((function(e){t=e})),cancel:t}}}const fe=pe,de={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(de).forEach((([t,e])=>{de[e]=t}));const ye=de,ve=function t(e){const n=new he(e),r=T(he.prototype.request,n);return lt.extend(r,he.prototype,n,{allOwnKeys:!0}),lt.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return t(ie(e,n))},r}(Ft);ve.Axios=he,ve.CanceledError=Gt,ve.CancelToken=fe,ve.isCancel=Jt,ve.VERSION="1.6.7",ve.toFormData=wt,ve.AxiosError=dt,ve.Cancel=ve.CanceledError,ve.all=function(t){return Promise.all(t)},ve.spread=function(t){return function(e){return t.apply(null,e)}},ve.isAxiosError=function(t){return lt.isObject(t)&&!0===t.isAxiosError},ve.mergeConfig=ie,ve.AxiosHeaders=Kt,ve.formToJSON=t=>Ut(lt.isHTMLForm(t)?new FormData(t):t),ve.getAdapter=ee,ve.HttpStatusCode=ye,ve.default=ve;const me=ve;function ge(t,e,n){return e=f(e),p(t,we()?Reflect.construct(e,n||[],f(t).constructor):e.apply(t,n))}function we(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(we=function(){return!!t})()}var be=function(t){function e(){return o(this,e),ge(this,e,arguments)}return y(e,t),c(e)}(b);function Ce(t,e,n){return e=f(e),p(t,ke()?Reflect.construct(e,n||[],f(t).constructor):e.apply(t,n))}function ke(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ke=function(){return!!t})()}var Ee=function(t){function e(){return o(this,e),Ce(this,e,arguments)}return y(e,t),c(e)}(b);function Se(t,e,n){return e=f(e),p(t,Re()?Reflect.construct(e,n||[],f(t).constructor):e.apply(t,n))}function Re(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Re=function(){return!!t})()}var Oe=function(t){function e(){return o(this,e),Se(this,e,arguments)}return y(e,t),c(e)}(b);function Pe(t,e,n){return e=f(e),p(t,xe()?Reflect.construct(e,n||[],f(t).constructor):e.apply(t,n))}function xe(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(xe=function(){return!!t})()}var Ae=function(t){function e(){return o(this,e),Pe(this,e,arguments)}return y(e,t),c(e)}(b);function Te(t,e,n){return e=f(e),p(t,Ne()?Reflect.construct(e,n||[],f(t).constructor):e.apply(t,n))}function Ne(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Ne=function(){return!!t})()}var je=function(t){function e(){return o(this,e),Te(this,e,arguments)}return y(e,t),c(e)}(b);function _e(t,e,n){return e=f(e),p(t,Ue()?Reflect.construct(e,n||[],f(t).constructor):e.apply(t,n))}function Ue(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Ue=function(){return!!t})()}var Le=function(t){function e(){return o(this,e),_e(this,e,arguments)}return y(e,t),c(e)}(b);function Fe(t,e,n){return e=f(e),p(t,Be()?Reflect.construct(e,n||[],f(t).constructor):e.apply(t,n))}function Be(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Be=function(){return!!t})()}var He=function(t){function e(){return o(this,e),Fe(this,e,arguments)}return y(e,t),c(e)}(b),De=!0,qe=function(){function t(e){o(this,t),this.configuration=e,this.apiKey=this.configuration.apiKey,this.nodes=null==this.configuration.nodes?this.configuration.nodes:JSON.parse(JSON.stringify(this.configuration.nodes)),this.nearestNode=null==this.configuration.nearestNode?this.configuration.nearestNode:JSON.parse(JSON.stringify(this.configuration.nearestNode)),this.connectionTimeoutSeconds=this.configuration.connectionTimeoutSeconds,this.healthcheckIntervalSeconds=this.configuration.healthcheckIntervalSeconds,this.numRetriesPerRequest=this.configuration.numRetries,this.retryIntervalSeconds=this.configuration.retryIntervalSeconds,this.sendApiKeyAsQueryParam=this.configuration.sendApiKeyAsQueryParam,this.additionalUserHeaders=this.configuration.additionalHeaders,this.logger=this.configuration.logger,this.initializeMetadataForNodes(),this.currentNodeIndex=-1}var e,n,r,a,s,u,l;return c(t,[{key:"get",value:(l=P(A().mark((function t(e){var n,r,o,i,a,s,c=arguments;return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=c.length>1&&void 0!==c[1]?c[1]:{},o=(r=c.length>2&&void 0!==c[2]?c[2]:{}).abortSignal,i=void 0===o?null:o,a=r.responseType,s=void 0===a?void 0:a,t.abrupt("return",this.performRequest("get",e,{queryParameters:n,abortSignal:i,responseType:s}));case 3:case"end":return t.stop()}}),t,this)}))),function(t){return l.apply(this,arguments)})},{key:"delete",value:(u=P(A().mark((function t(e){var n,r=arguments;return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=r.length>1&&void 0!==r[1]?r[1]:{},t.abrupt("return",this.performRequest("delete",e,{queryParameters:n}));case 2:case"end":return t.stop()}}),t,this)}))),function(t){return u.apply(this,arguments)})},{key:"post",value:(s=P(A().mark((function t(e){var n,r,o,i=arguments;return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=i.length>1&&void 0!==i[1]?i[1]:{},r=i.length>2&&void 0!==i[2]?i[2]:{},o=i.length>3&&void 0!==i[3]?i[3]:{},t.abrupt("return",this.performRequest("post",e,{queryParameters:r,bodyParameters:n,additionalHeaders:o}));case 4:case"end":return t.stop()}}),t,this)}))),function(t){return s.apply(this,arguments)})},{key:"put",value:(a=P(A().mark((function t(e){var n,r,o=arguments;return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=o.length>1&&void 0!==o[1]?o[1]:{},r=o.length>2&&void 0!==o[2]?o[2]:{},t.abrupt("return",this.performRequest("put",e,{queryParameters:r,bodyParameters:n}));case 3:case"end":return t.stop()}}),t,this)}))),function(t){return a.apply(this,arguments)})},{key:"patch",value:(r=P(A().mark((function t(e){var n,r,o=arguments;return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=o.length>1&&void 0!==o[1]?o[1]:{},r=o.length>2&&void 0!==o[2]?o[2]:{},t.abrupt("return",this.performRequest("patch",e,{queryParameters:r,bodyParameters:n}));case 3:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"performRequest",value:(n=P(A().mark((function t(e,n,r){var o,a,s,c,u,l,h,p,f,d,y,v,m,g,w,b,C,k=this;return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=r.queryParameters,a=void 0===o?null:o,s=r.bodyParameters,c=void 0===s?null:s,u=r.additionalHeaders,l=void 0===u?{}:u,h=r.abortSignal,p=void 0===h?null:h,f=r.responseType,d=void 0===f?void 0:f,y=r.skipConnectionTimeout,v=void 0!==y&&y,this.configuration.validate(),m=Date.now(),this.logger.debug("Request #".concat(m,": Performing ").concat(e.toUpperCase()," request: ").concat(n)),w=A().mark((function t(){var r,o,s,u,h,f,y,w,b;return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=k.getNextNode(m),k.logger.debug("Request #".concat(m,": Attempting ").concat(e.toUpperCase()," request Try #").concat(C," to Node ").concat(r.index)),!p||!p.aborted){t.next=4;break}return t.abrupt("return",{v:Promise.reject(new Error("Request aborted by caller."))});case 4:return t.prev=4,s={method:e,url:k.uriFor(n,r),headers:Object.assign({},k.defaultHeaders(),l,k.additionalUserHeaders),maxContentLength:1/0,maxBodyLength:1/0,responseType:d,validateStatus:function(t){return t>0},transformResponse:[function(t,e){var n=t;return void 0!==e&&"string"==typeof t&&e["content-type"]&&e["content-type"].startsWith("application/json")&&(n=JSON.parse(t)),n}]},!0!==v&&(s.timeout=1e3*k.connectionTimeoutSeconds),a&&0!==Object.keys(a).length&&(s.params=a),k.sendApiKeyAsQueryParam&&(s.params=s.params||{},s.params["x-typesense-api-key"]=k.apiKey),k.configuration.httpAgent&&(k.logger.debug("Request #".concat(m,": Using custom httpAgent")),s.httpAgent=k.configuration.httpAgent),k.configuration.httpsAgent&&(k.logger.debug("Request #".concat(m,": Using custom httpsAgent")),s.httpsAgent=k.configuration.httpsAgent),c&&("string"==typeof c&&0!==c.length||"object"===i(c)&&0!==Object.keys(c).length)&&(s.data=c),p&&(u=me.CancelToken,h=u.source(),o=function(){return h.cancel()},p.addEventListener("abort",o),s.cancelToken=h.token),t.next=15,me(s);case 15:if((f=t.sent).status>=1&&f.status<=499&&k.setNodeHealthcheck(r,De),k.logger.debug("Request #".concat(m,": Request to Node ").concat(r.index," was made. Response Code was ").concat(f.status,".")),!(f.status>=200&&f.status<300)){t.next=22;break}return t.abrupt("return",{v:Promise.resolve(f.data)});case 22:if(!(f.status<500)){t.next=26;break}return t.abrupt("return",{v:Promise.reject(k.customErrorForResponse(f,null===(y=f.data)||void 0===y?void 0:y.message))});case 26:throw k.customErrorForResponse(f,null===(w=f.data)||void 0===w?void 0:w.message);case 27:t.next=37;break;case 29:return t.prev=29,t.t0=t.catch(4),k.setNodeHealthcheck(r,!1),g=t.t0,k.logger.warn("Request #".concat(m,": Request to Node ").concat(r.index,' failed due to "').concat(t.t0.code," ").concat(t.t0.message).concat(null==t.t0.response?"":" - "+JSON.stringify(null===(b=t.t0.response)||void 0===b?void 0:b.data),'"')),k.logger.warn("Request #".concat(m,": Sleeping for ").concat(k.retryIntervalSeconds,"s and then retrying request...")),t.next=37,k.timer(k.retryIntervalSeconds);case 37:return t.prev=37,p&&o&&p.removeEventListener("abort",o),t.finish(37);case 40:case"end":return t.stop()}}),t,null,[[4,29,37,40]])})),C=1;case 6:if(!(C<=this.numRetriesPerRequest+1)){t.next=14;break}return t.delegateYield(w(),"t0",8);case 8:if(!(b=t.t0)){t.next=11;break}return t.abrupt("return",b.v);case 11:C++,t.next=6;break;case 14:return this.logger.debug("Request #".concat(m,": No retries left. Raising last error")),t.abrupt("return",Promise.reject(g));case 16:case"end":return t.stop()}}),t,this)}))),function(t,e,r){return n.apply(this,arguments)})},{key:"getNextNode",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(null!=this.nearestNode){if(this.logger.debug("Request #".concat(t,": Nodes Health: Node ").concat(this.nearestNode.index," is ").concat(!0===this.nearestNode.isHealthy?"Healthy":"Unhealthy")),!0===this.nearestNode.isHealthy||this.nodeDueForHealthcheck(this.nearestNode,t))return this.logger.debug("Request #".concat(t,": Updated current node to Node ").concat(this.nearestNode.index)),this.nearestNode;this.logger.debug("Request #".concat(t,": Falling back to individual nodes"))}this.logger.debug("Request #".concat(t,": Nodes Health: ").concat(this.nodes.map((function(t){return"Node ".concat(t.index," is ").concat(!0===t.isHealthy?"Healthy":"Unhealthy")})).join(" || ")));for(var e=this.nodes[0],n=0;n<=this.nodes.length;n++)if(this.currentNodeIndex=(this.currentNodeIndex+1)%this.nodes.length,!0===(e=this.nodes[this.currentNodeIndex]).isHealthy||this.nodeDueForHealthcheck(e,t))return this.logger.debug("Request #".concat(t,": Updated current node to Node ").concat(e.index)),e;return this.logger.debug("Request #".concat(t,": No healthy nodes were found. Returning the next node, Node ").concat(e.index)),e}},{key:"nodeDueForHealthcheck",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=Date.now()-t.lastAccessTimestamp>1e3*this.healthcheckIntervalSeconds;return n&&this.logger.debug("Request #".concat(e,": Node ").concat(t.index," has exceeded healtcheckIntervalSeconds of ").concat(this.healthcheckIntervalSeconds,". Adding it back into rotation.")),n}},{key:"initializeMetadataForNodes",value:function(){var t=this;null!=this.nearestNode&&(this.nearestNode.index="nearestNode",this.setNodeHealthcheck(this.nearestNode,De)),this.nodes.forEach((function(e,n){e.index=n,t.setNodeHealthcheck(e,De)}))}},{key:"setNodeHealthcheck",value:function(t,e){t.isHealthy=e,t.lastAccessTimestamp=Date.now()}},{key:"uriFor",value:function(t,e){return null!=e.url?"".concat(e.url).concat(t):"".concat(e.protocol,"://").concat(e.host,":").concat(e.port).concat(e.path).concat(t)}},{key:"defaultHeaders",value:function(){var t={};return this.sendApiKeyAsQueryParam||(t["X-TYPESENSE-API-KEY"]=this.apiKey),t["Content-Type"]="application/json",t}},{key:"timer",value:(e=P(A().mark((function t(e){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){return setTimeout(t,1e3*e)})));case 1:case"end":return t.stop()}}),t)}))),function(t){return e.apply(this,arguments)})},{key:"customErrorForResponse",value:function(t,e){var n="Request failed with HTTP code ".concat(t.status);"string"==typeof e&&""!==e.trim()&&(n+=" | Server said: ".concat(e));var r=new b(n);return(r=400===t.status?new be(n):401===t.status?new Ee(n):404===t.status?new Oe(n):409===t.status?new Ae(n):422===t.status?new je(n):t.status>=500&&t.status<=599?new Le(n):new He(n)).httpStatus=t.status,r}}]),t}(),Ie="/collections",Me=function(){function t(e){o(this,t),this.apiCall=e}var e,n;return c(t,[{key:"create",value:(n=P(A().mark((function t(e){var n,r=arguments;return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=r.length>1&&void 0!==r[1]?r[1]:{},t.abrupt("return",this.apiCall.post(Ie,e,n));case 2:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"retrieve",value:(e=P(A().mark((function t(){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.apiCall.get(Ie));case 1:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})}],[{key:"RESOURCEPATH",get:function(){return Ie}}]),t}();function Ke(t,e,n){return e=f(e),p(t,ze()?Reflect.construct(e,n||[],f(t).constructor):e.apply(t,n))}function ze(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ze=function(){return!!t})()}var Je=function(t){function e(t,n){var r;return o(this,e),(r=Ke(this,e,[t])).importResults=n,r}return y(e,t),c(e)}(b);function We(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nc&&(y=this.responseCache.keys().next().value,this.responseCache.delete(y)),this.responsePromiseCache.size>c&&(v=this.responsePromiseCache.keys().next().value,this.responsePromiseCache.delete(v)),t.abrupt("return",d);case 37:case"end":return t.stop()}}),t,this)}))),function(t,n,r,o){return e.apply(this,arguments)})}]),t}(),$e="/documents",Xe=function(){function t(e,n,r){o(this,t),u(this,"requestWithCache",new Ve),this.collectionName=e,this.apiCall=n,this.configuration=r}var e;return c(t,[{key:"clearCache",value:function(){this.requestWithCache.clearCache()}},{key:"search",value:(e=P(A().mark((function t(e){var n,r,o,i,a,s,c,u,l=arguments;return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(c in r=(n=l.length>1&&void 0!==l[1]?l[1]:{}).cacheSearchResultsForSeconds,o=void 0===r?this.configuration.cacheSearchResultsForSeconds:r,i=n.abortSignal,a=void 0===i?null:i,s={},!0===this.configuration.useServerSideSearchCache&&(s.use_cache=!0),e)Array.isArray(e[c])&&(s[c]=e[c].join(","));return u=Object.assign({},e,s),t.abrupt("return",this.requestWithCache.perform(this.apiCall,this.apiCall.get,[this.endpointPath("search"),u,{abortSignal:a}],{cacheResponseForSeconds:o}));case 6:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"endpointPath",value:function(t){return"".concat(Me.RESOURCEPATH,"/").concat(this.collectionName).concat($e).concat(void 0===t?"":"/"+t)}}],[{key:"RESOURCEPATH",get:function(){return $e}}]),t}();function Ye(t,e,n){return e=f(e),p(t,Ze()?Reflect.construct(e,n||[],f(t).constructor):e.apply(t,n))}function Ze(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Ze=function(){return!!t})()}var tn=function(t){function e(t,n,r){return o(this,e),Ye(this,e,[t,n,r])}var n,r,i,a,s,u,l,h;return y(e,t),c(e,[{key:"create",value:(h=P(A().mark((function t(e){var n,r=arguments;return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=r.length>1&&void 0!==r[1]?r[1]:{},e){t.next=3;break}throw new Error("No document provided");case 3:return t.abrupt("return",this.apiCall.post(this.endpointPath(),e,n));case 4:case"end":return t.stop()}}),t,this)}))),function(t){return h.apply(this,arguments)})},{key:"upsert",value:(l=P(A().mark((function t(e){var n,r=arguments;return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=r.length>1&&void 0!==r[1]?r[1]:{},e){t.next=3;break}throw new Error("No document provided");case 3:return t.abrupt("return",this.apiCall.post(this.endpointPath(),e,Object.assign({},n,{action:"upsert"})));case 4:case"end":return t.stop()}}),t,this)}))),function(t){return l.apply(this,arguments)})},{key:"update",value:(u=P(A().mark((function t(e){var n,r=arguments;return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=r.length>1&&void 0!==r[1]?r[1]:{},e){t.next=3;break}throw new Error("No document provided");case 3:if(null==n.filter_by){t.next=7;break}return t.abrupt("return",this.apiCall.patch(this.endpointPath(),e,Object.assign({},n)));case 7:return t.abrupt("return",this.apiCall.post(this.endpointPath(),e,Object.assign({},n,{action:"update"})));case 8:case"end":return t.stop()}}),t,this)}))),function(t){return u.apply(this,arguments)})},{key:"delete",value:(s=P(A().mark((function t(){var e,n=arguments;return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=n.length>0&&void 0!==n[0]?n[0]:{},t.abrupt("return",this.apiCall.delete(this.endpointPath(),e));case 2:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"createMany",value:(a=P(A().mark((function t(e){var n,r=arguments;return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=r.length>1&&void 0!==r[1]?r[1]:{},this.configuration.logger.warn("createMany is deprecated and will be removed in a future version. Use import instead, which now takes both an array of documents or a JSONL string of documents"),t.abrupt("return",this.import(e,n));case 3:case"end":return t.stop()}}),t,this)}))),function(t){return a.apply(this,arguments)})},{key:"import",value:(i=P(A().mark((function t(e){var n,r,o,i,a,s=arguments;return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=s.length>1&&void 0!==s[1]?s[1]:{},!Array.isArray(e)){t.next=13;break}t.prev=2,r=e.map((function(t){return JSON.stringify(t)})).join("\n"),t.next=11;break;case 6:if(t.prev=6,t.t0=t.catch(2),!(RangeError instanceof t.t0&&null!==t.t0&&void 0!==t.t0&&t.t0.includes("Too many properties to enumerate"))){t.next=10;break}throw new Error("".concat(t.t0,"\n It looks like you have reached a Node.js limit that restricts the number of keys in an Object: https://stackoverflow.com/questions/9282869/are-there-limits-to-the-number-of-properties-in-a-javascript-object\n\n Please try reducing the number of keys in your document, or using CURL to import your data.\n "));case 10:throw new Error(t.t0);case 11:t.next=14;break;case 13:r=e;case 14:return t.next=16,this.apiCall.performRequest("post",this.endpointPath("import"),{queryParameters:n,bodyParameters:r,additionalHeaders:{"Content-Type":"text/plain"},skipConnectionTimeout:!0});case 16:if(o=t.sent,!Array.isArray(e)){t.next=27;break}if(i=o.split("\n").map((function(t){return JSON.parse(t)})),!((a=i.filter((function(t){return!1===t.success}))).length>0)){t.next=24;break}throw new Je("".concat(i.length-a.length," documents imported successfully, ").concat(a.length," documents failed during import. Use `error.importResults` from the raised exception to get a detailed error reason for each document."),i);case 24:return t.abrupt("return",i);case 25:t.next=28;break;case 27:return t.abrupt("return",o);case 28:case"end":return t.stop()}}),t,this,[[2,6]])}))),function(t){return i.apply(this,arguments)})},{key:"export",value:(r=P(A().mark((function t(){var e,n=arguments;return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=n.length>0&&void 0!==n[0]?n[0]:{},t.abrupt("return",this.apiCall.get(this.endpointPath("export"),e));case 2:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"exportStream",value:(n=P(A().mark((function t(){var e,n=arguments;return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=n.length>0&&void 0!==n[0]?n[0]:{},t.abrupt("return",this.apiCall.get(this.endpointPath("export"),e,{responseType:"stream"}));case 2:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})}]),e}(Xe),en=function(){function t(e,n){o(this,t),this.collectionName=e,this.apiCall=n}var e,n;return c(t,[{key:"upsert",value:(n=P(A().mark((function t(e,n){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.apiCall.put(this.endpointPath(e),n));case 1:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"retrieve",value:(e=P(A().mark((function t(){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"endpointPath",value:function(e){return"".concat(Me.RESOURCEPATH,"/").concat(this.collectionName).concat(t.RESOURCEPATH).concat(void 0===e?"":"/"+e)}}],[{key:"RESOURCEPATH",get:function(){return"/overrides"}}]),t}(),nn=function(){function t(e,n,r){o(this,t),this.collectionName=e,this.overrideId=n,this.apiCall=r}var e,n;return c(t,[{key:"retrieve",value:(n=P(A().mark((function t(){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"delete",value:(e=P(A().mark((function t(){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.apiCall.delete(this.endpointPath()));case 1:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"endpointPath",value:function(){return"".concat(Me.RESOURCEPATH,"/").concat(this.collectionName).concat(en.RESOURCEPATH,"/").concat(this.overrideId)}}]),t}(),rn=function(){function t(e,n){o(this,t),this.collectionName=e,this.apiCall=n}var e,n;return c(t,[{key:"upsert",value:(n=P(A().mark((function t(e,n){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.apiCall.put(this.endpointPath(e),n));case 1:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"retrieve",value:(e=P(A().mark((function t(){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"endpointPath",value:function(e){return"".concat(Me.RESOURCEPATH,"/").concat(this.collectionName).concat(t.RESOURCEPATH).concat(void 0===e?"":"/"+e)}}],[{key:"RESOURCEPATH",get:function(){return"/synonyms"}}]),t}(),on=function(){function t(e,n,r){o(this,t),this.collectionName=e,this.synonymId=n,this.apiCall=r}var e,n;return c(t,[{key:"retrieve",value:(n=P(A().mark((function t(){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"delete",value:(e=P(A().mark((function t(){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.apiCall.delete(this.endpointPath()));case 1:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"endpointPath",value:function(){return"".concat(Me.RESOURCEPATH,"/").concat(this.collectionName).concat(rn.RESOURCEPATH,"/").concat(this.synonymId)}}]),t}(),an=function(){function t(e,n,r){o(this,t),this.collectionName=e,this.documentId=n,this.apiCall=r}var e,n,r;return c(t,[{key:"retrieve",value:(r=P(A().mark((function t(){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"delete",value:(n=P(A().mark((function t(){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.apiCall.delete(this.endpointPath()));case 1:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"update",value:(e=P(A().mark((function t(e){var n,r=arguments;return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=r.length>1&&void 0!==r[1]?r[1]:{},t.abrupt("return",this.apiCall.patch(this.endpointPath(),e,n));case 2:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"endpointPath",value:function(){return"".concat(Me.RESOURCEPATH,"/").concat(this.collectionName).concat(tn.RESOURCEPATH,"/").concat(this.documentId)}}]),t}(),sn=function(){function t(e,n,r){o(this,t),u(this,"individualDocuments",{}),u(this,"individualOverrides",{}),u(this,"individualSynonyms",{}),this.name=e,this.apiCall=n,this.configuration=r,this.name=e,this.apiCall=n,this.configuration=r,this._documents=new tn(this.name,this.apiCall,this.configuration),this._overrides=new en(this.name,this.apiCall),this._synonyms=new rn(this.name,this.apiCall)}var e,n,r,i;return c(t,[{key:"retrieve",value:(i=P(A().mark((function t(){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"update",value:(r=P(A().mark((function t(e){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.apiCall.patch(this.endpointPath(),e));case 1:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"delete",value:(n=P(A().mark((function t(){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.apiCall.delete(this.endpointPath()));case 1:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"exists",value:(e=P(A().mark((function t(){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.retrieve();case 3:return t.abrupt("return",!0);case 6:if(t.prev=6,t.t0=t.catch(0),!(t.t0 instanceof Oe)){t.next=10;break}return t.abrupt("return",!1);case 10:throw t.t0;case 11:case"end":return t.stop()}}),t,this,[[0,6]])}))),function(){return e.apply(this,arguments)})},{key:"documents",value:function(t){return t?(void 0===this.individualDocuments[t]&&(this.individualDocuments[t]=new an(this.name,t,this.apiCall)),this.individualDocuments[t]):this._documents}},{key:"overrides",value:function(t){return void 0===t?this._overrides:(void 0===this.individualOverrides[t]&&(this.individualOverrides[t]=new nn(this.name,t,this.apiCall)),this.individualOverrides[t])}},{key:"synonyms",value:function(t){return void 0===t?this._synonyms:(void 0===this.individualSynonyms[t]&&(this.individualSynonyms[t]=new on(this.name,t,this.apiCall)),this.individualSynonyms[t])}},{key:"endpointPath",value:function(){return"".concat(Me.RESOURCEPATH,"/").concat(this.name)}}]),t}(),cn="/aliases",un=function(){function t(e){o(this,t),this.apiCall=e}var e,n;return c(t,[{key:"upsert",value:(n=P(A().mark((function t(e,n){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.apiCall.put(this.endpointPath(e),n));case 1:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"retrieve",value:(e=P(A().mark((function t(){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.apiCall.get(cn));case 1:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"endpointPath",value:function(e){return"".concat(t.RESOURCEPATH,"/").concat(e)}}],[{key:"RESOURCEPATH",get:function(){return cn}}]),t}(),ln=function(){function t(e,n){o(this,t),this.name=e,this.apiCall=n}var e,n;return c(t,[{key:"retrieve",value:(n=P(A().mark((function t(){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"delete",value:(e=P(A().mark((function t(){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.apiCall.delete(this.endpointPath()));case 1:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"endpointPath",value:function(){return"".concat(un.RESOURCEPATH,"/").concat(this.name)}}]),t}(),hn=n(565),pn="/keys",fn=function(){function t(e){o(this,t),this.apiCall=e,this.apiCall=e}var e,n;return c(t,[{key:"create",value:(n=P(A().mark((function e(n){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.post(t.RESOURCEPATH,n));case 1:case"end":return e.stop()}}),e,this)}))),function(t){return n.apply(this,arguments)})},{key:"retrieve",value:(e=P(A().mark((function t(){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.apiCall.get(pn));case 1:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"generateScopedSearchKey",value:function(t,e){var n=JSON.stringify(e),r=Buffer.from((0,hn.createHmac)("sha256",t).update(n).digest("base64")),o=t.substr(0,4),i="".concat(r).concat(o).concat(n);return Buffer.from(i).toString("base64")}}],[{key:"RESOURCEPATH",get:function(){return pn}}]),t}(),dn=function(){function t(e,n){o(this,t),this.id=e,this.apiCall=n}var e,n;return c(t,[{key:"retrieve",value:(n=P(A().mark((function t(){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"delete",value:(e=P(A().mark((function t(){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.apiCall.delete(this.endpointPath()));case 1:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"endpointPath",value:function(){return"".concat(fn.RESOURCEPATH,"/").concat(this.id)}}]),t}(),yn=function(){function t(e){o(this,t),this.apiCall=e}var e;return c(t,[{key:"retrieve",value:(e=P(A().mark((function t(){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.apiCall.get("/debug"));case 1:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})}]),t}(),vn=function(){function t(e){o(this,t),this.apiCall=e}var e;return c(t,[{key:"retrieve",value:(e=P(A().mark((function t(){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.apiCall.get("/metrics.json"));case 1:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})}]),t}(),mn=function(){function t(e){o(this,t),this.apiCall=e}var e;return c(t,[{key:"retrieve",value:(e=P(A().mark((function t(){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.apiCall.get("/health"));case 1:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})}]),t}(),gn=function(){function t(e){o(this,t),this.apiCall=e}var e;return c(t,[{key:"perform",value:(e=P(A().mark((function t(e){var n,r=arguments;return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=r.length>1&&void 0!==r[1]?r[1]:{},t.abrupt("return",this.apiCall.post("".concat("/operations","/").concat(e),{},n));case 2:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})}]),t}(),wn=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];o(this,t),this.apiCall=e,this.configuration=n,this.useTextContentType=r,this.requestWithCache=new Ve}var e;return c(t,[{key:"clearCache",value:function(){this.requestWithCache.clearCache()}},{key:"perform",value:(e=P(A().mark((function t(e){var n,r,o,i,a,s,c=arguments;return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=c.length>1&&void 0!==c[1]?c[1]:{},r=(c.length>2&&void 0!==c[2]?c[2]:{}).cacheSearchResultsForSeconds,o=void 0===r?this.configuration.cacheSearchResultsForSeconds:r,i={},this.useTextContentType&&(i["content-type"]="text/plain"),a={},!0===this.configuration.useServerSideSearchCache&&(a.use_cache=!0),s=Object.assign({},n,a),t.abrupt("return",this.requestWithCache.perform(this.apiCall,this.apiCall.post,["/multi_search",e,s,i],{cacheResponseForSeconds:o}));case 8:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})}]),t}(),bn=function(){function t(e){o(this,t),this.apiCall=e}var e,n;return c(t,[{key:"upsert",value:(n=P(A().mark((function t(e,n){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.apiCall.put(this.endpointPath(e),n));case 1:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"retrieve",value:(e=P(A().mark((function t(){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"endpointPath",value:function(e){return"".concat(t.RESOURCEPATH).concat(void 0===e?"":"/"+e)}}],[{key:"RESOURCEPATH",get:function(){return"/presets"}}]),t}(),Cn=function(){function t(e,n){o(this,t),this.presetId=e,this.apiCall=n}var e,n;return c(t,[{key:"retrieve",value:(n=P(A().mark((function t(){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"delete",value:(e=P(A().mark((function t(){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.apiCall.delete(this.endpointPath()));case 1:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"endpointPath",value:function(){return"".concat(bn.RESOURCEPATH,"/").concat(this.presetId)}}]),t}(),kn=function(){function t(e){o(this,t),this.apiCall=e,this.apiCall=e}var e,n;return c(t,[{key:"upsert",value:(n=P(A().mark((function t(e,n){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.apiCall.put(this.endpointPath(e),n));case 1:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"retrieve",value:(e=P(A().mark((function t(){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"endpointPath",value:function(e){return"".concat(t.RESOURCEPATH).concat(void 0===e?"":"/"+e)}}],[{key:"RESOURCEPATH",get:function(){return"/analytics/rules"}}]),t}(),En=function(){function t(e,n){o(this,t),this.name=e,this.apiCall=n}var e,n;return c(t,[{key:"retrieve",value:(n=P(A().mark((function t(){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"delete",value:(e=P(A().mark((function t(){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.apiCall.delete(this.endpointPath()));case 1:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"endpointPath",value:function(){return"".concat(kn.RESOURCEPATH,"/").concat(this.name)}}]),t}(),Sn=function(){function t(e){o(this,t),u(this,"individualAnalyticsRules",{}),this.apiCall=e,this.apiCall=e,this._analyticsRules=new kn(this.apiCall)}return c(t,[{key:"rules",value:function(t){return void 0===t?this._analyticsRules:(void 0===this.individualAnalyticsRules[t]&&(this.individualAnalyticsRules[t]=new En(t,this.apiCall)),this.individualAnalyticsRules[t])}}],[{key:"RESOURCEPATH",get:function(){return"/analytics"}}]),t}(),Rn=function(){function t(e){o(this,t),this.apiCall=e}var e,n;return c(t,[{key:"upsert",value:(n=P(A().mark((function t(e,n){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.apiCall.put(this.endpointPath(e),n));case 1:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"retrieve",value:(e=P(A().mark((function t(){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"endpointPath",value:function(e){return"".concat(t.RESOURCEPATH).concat(void 0===e?"":"/"+e)}}],[{key:"RESOURCEPATH",get:function(){return"/stopwords"}}]),t}(),On=function(){function t(e,n){o(this,t),this.stopwordId=e,this.apiCall=n}var e,n;return c(t,[{key:"retrieve",value:(n=P(A().mark((function t(){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"delete",value:(e=P(A().mark((function t(){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.apiCall.delete(this.endpointPath()));case 1:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"endpointPath",value:function(){return"".concat(Rn.RESOURCEPATH,"/").concat(this.stopwordId)}}]),t}(),Pn=function(){function t(e){o(this,t),this.apiCall=e,this.apiCall=e}var e,n;return c(t,[{key:"create",value:(n=P(A().mark((function t(e){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.apiCall.post(this.endpointPath(),e));case 1:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"retrieve",value:(e=P(A().mark((function t(){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"endpointPath",value:function(e){return"".concat(t.RESOURCEPATH).concat(void 0===e?"":"/"+e)}}],[{key:"RESOURCEPATH",get:function(){return"/conversations/models"}}]),t}(),xn=function(){function t(e,n){o(this,t),this.id=e,this.apiCall=n}var e,n,r;return c(t,[{key:"update",value:(r=P(A().mark((function t(e){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.apiCall.put(this.endpointPath(),e));case 1:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"retrieve",value:(n=P(A().mark((function t(){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"delete",value:(e=P(A().mark((function t(){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.apiCall.delete(this.endpointPath()));case 1:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"endpointPath",value:function(){return"".concat(Pn.RESOURCEPATH,"/").concat(this.id)}}]),t}(),An="/conversations",Tn=function(){function t(e){o(this,t),u(this,"individualConversationModels",{}),this.apiCall=e,this.apiCall=e,this._conversationsModels=new Pn(this.apiCall)}var e;return c(t,[{key:"retrieve",value:(e=P(A().mark((function t(){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.apiCall.get(An));case 1:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"models",value:function(t){return void 0===t?this._conversationsModels:(void 0===this.individualConversationModels[t]&&(this.individualConversationModels[t]=new xn(t,this.apiCall)),this.individualConversationModels[t])}}],[{key:"RESOURCEPATH",get:function(){return An}}]),t}(),Nn=function(){function t(e,n){o(this,t),this.id=e,this.apiCall=n}var e,n,r;return c(t,[{key:"retrieve",value:(r=P(A().mark((function t(){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"update",value:(n=P(A().mark((function t(e){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.apiCall.put(this.endpointPath(),e));case 1:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"delete",value:(e=P(A().mark((function t(){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.apiCall.delete(this.endpointPath()));case 1:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"endpointPath",value:function(){return"".concat(Tn.RESOURCEPATH,"/").concat(this.id)}}]),t}(),jn=function(){function t(e){var n;o(this,t),e.sendApiKeyAsQueryParam=null!==(n=e.sendApiKeyAsQueryParam)&&void 0!==n&&n,this.configuration=new R(e),this.apiCall=new qe(this.configuration),this.debug=new yn(this.apiCall),this.metrics=new vn(this.apiCall),this.health=new mn(this.apiCall),this.operations=new gn(this.apiCall),this.multiSearch=new wn(this.apiCall,this.configuration),this._collections=new Me(this.apiCall),this.individualCollections={},this._aliases=new un(this.apiCall),this.individualAliases={},this._keys=new fn(this.apiCall),this.individualKeys={},this._presets=new bn(this.apiCall),this.individualPresets={},this._stopwords=new Rn(this.apiCall),this.individualStopwords={},this.analytics=new Sn(this.apiCall),this._conversations=new Tn(this.apiCall),this.individualConversations={}}return c(t,[{key:"collections",value:function(t){return void 0===t?this._collections:(void 0===this.individualCollections[t]&&(this.individualCollections[t]=new sn(t,this.apiCall,this.configuration)),this.individualCollections[t])}},{key:"aliases",value:function(t){return void 0===t?this._aliases:(void 0===this.individualAliases[t]&&(this.individualAliases[t]=new ln(t,this.apiCall)),this.individualAliases[t])}},{key:"keys",value:function(t){return void 0===t?this._keys:(void 0===this.individualKeys[t]&&(this.individualKeys[t]=new dn(t,this.apiCall)),this.individualKeys[t])}},{key:"presets",value:function(t){return void 0===t?this._presets:(void 0===this.individualPresets[t]&&(this.individualPresets[t]=new Cn(t,this.apiCall)),this.individualPresets[t])}},{key:"stopwords",value:function(t){return void 0===t?this._stopwords:(void 0===this.individualStopwords[t]&&(this.individualStopwords[t]=new On(t,this.apiCall)),this.individualStopwords[t])}},{key:"conversations",value:function(t){return void 0===t?this._conversations:(void 0===this.individualConversations[t]&&(this.individualConversations[t]=new Nn(t,this.apiCall)),this.individualConversations[t])}}]),t}();var _n=function(){function t(e,n,r){o(this,t),this.name=e,this.apiCall=n,this.configuration=r,this._documents=new Xe(this.name,this.apiCall,this.configuration)}return c(t,[{key:"documents",value:function(){return this._documents}}]),t}(),Un=function(){function t(e){var n;o(this,t),e.sendApiKeyAsQueryParam=null===(n=e.sendApiKeyAsQueryParam)||void 0===n||n,!0===e.sendApiKeyAsQueryParam&&(e.apiKey||"").length>2e3&&(console.warn("[typesense] API Key is longer than 2000 characters which is over the allowed limit, so disabling sending it as a query parameter."),e.sendApiKeyAsQueryParam=!1),this.configuration=new R(e),this.apiCall=new qe(this.configuration),this.multiSearch=new wn(this.apiCall,this.configuration,!0),this.individualCollections={}}return c(t,[{key:"clearCache",value:function(){this.multiSearch.clearCache(),Object.entries(this.individualCollections).forEach((function(t){var e,n,r=(n=2,function(t){if(Array.isArray(t))return t}(e=t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],c=!0,u=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);c=!0);}catch(t){u=!0,o=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,n)||Ge(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());r[0],r[1].documents().clearCache()}))}},{key:"collections",value:function(t){if(t)return void 0===this.individualCollections[t]&&(this.individualCollections[t]=new _n(t,this.apiCall,this.configuration)),this.individualCollections[t];throw new Error("Typesense.SearchClient only supports search operations, so the collectionName that needs to be searched must be specified. Use Typesense.Client if you need to access the collection object.")}}]),t}();const Ln={Client:jn,SearchClient:Un,Errors:e}})(),Typesense=r})(); //# sourceMappingURL=typesense.min.js.map